Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(python, rust): expr parsing date/timestamp #2357

Merged

Conversation

ion-elgreco
Copy link
Collaborator

Description

We weren't parsing all scalar values yet, parses date32/64 and timestampmicros now as well.

Related Issue(s)

@github-actions github-actions bot added binding/python Issues for the Python package binding/rust Issues for the Rust crate labels Mar 28, 2024
@ion-elgreco ion-elgreco force-pushed the fix/expr_parsing_date_timestamp branch 2 times, most recently from 3f8d32c to 9c75bd0 Compare March 29, 2024 06:54
@ion-elgreco ion-elgreco force-pushed the fix/expr_parsing_date_timestamp branch from 9c75bd0 to c206647 Compare March 29, 2024 12:22
Copy link
Collaborator

@Blajda Blajda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ion-elgreco
Copy link
Collaborator Author

@Blajda that datafusion sql parser is for some reason parsing a date/timestamp as a substraction : S I also tried wrapping it in single quotes but then it gets parsed as a string. So I am not sure what format datafusion expects datetimes to be

 left: BinaryExpr(BinaryExpr { left: Column(Column { relation: None, name: "_timestamp_ntz" }), op: Gt, right: Literal(TimestampMicrosecond(1262304000000000, None)) })
 right: BinaryExpr(BinaryExpr { left: Column(Column { relation: None, name: "_timestamp_ntz" }), op: Gt, right: BinaryExpr(BinaryExpr { left: BinaryExpr(BinaryExpr { left: Literal(Int64(2010)), op: Minus, right: Literal(Int64(1)) }), op: Minus, right: Literal(Int64(1)) }) })

@Blajda
Copy link
Collaborator

Blajda commented Mar 31, 2024

Yeah you can't dump it directly. The query dialect is postgress so you if you are using a string you can try the cast notation i.e '::date'. Alternative approach use the date functions and convert the scalars to their correct representations.

@ion-elgreco
Copy link
Collaborator Author

@Blajda yeah but then Im not really testing round tripping anymore.

Im assuming the string format needs to be in the same format as the serialization format for the conflict resolution across other engine writers

@Blajda
Copy link
Collaborator

Blajda commented Apr 1, 2024

There's no specification on the query format for conflict resolution with other engines. At least for our engine any queries we convert to a string we should be able to read it back without error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binding/python Issues for the Python package binding/rust Issues for the Rust crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot merge into table partitioned by date type column on 0.16.3
3 participants